package com.cy.dao;

import com.cy.domain.Goods;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface GoodsDAO {
    @Select("select * from tb_goods")
    List<Goods> findAll();

    @Delete("DELETE FROM tb_goods WHERE id = #{id}")
    Integer deleteById(Integer id);

    @Insert("insert into tb_goods(name,remark,createdTime) values(#{name},#{remark},now())")
    Integer goodsInsert(Goods goods);

    @Select("select * from tb_goods where id = #{id}")
    Goods selectOne(Integer id);

    @Update("update tb_goods set name = #{name} , remark = #{remark} where id = #{id}")
    Integer goodsUpdate(Goods goods);
}
